<p>
  A vector can be thought of as an arrow pointing from the origin to a specific point. Any vector or point can be represented by its coordinates i.e. an array of numbers, such as \((x,y)\) for a 2-dimensional vector, or \((x,y,z)\) for a 3-dimensional one. We usually write a vector as a column:
</p>
\[ \mathbf{v} = \begin{pmatrix}
x \\ y \\ z
\end{pmatrix} \]
<a name="scalar"></a>
<p>
  The <strong>scalar product</strong> of two vectors \( \mathbf{x} \) and \( \mathbf{y} \) in 2-dimensional space is defined as:
</p>
\[ \mathbf{x}^T \mathbf{y} = \begin{pmatrix} x_1 &amp; x_2 \end{pmatrix} \begin{pmatrix} y_1 \\ y_2 \end{pmatrix} = x_1 y_1 + x_2 y_2 \]

<p>
  This definition can be easily generalized to <em>n</em> dimensional space. Clearly, we cannot take the scalar product of two vectors with different dimensions.
</p>
